package vn.edu.saigontech.ncms.service;

import java.util.Collection;
import java.util.Date;

import vn.edu.saigontech.ncms.model.info.Offering;
import vn.edu.saigontech.ncms.service.impl.OfferingServiceImpl;

public interface OfferingService extends GenericService<Offering, Long> {
	
	static final OfferingService INSTANCE = new OfferingServiceImpl();
	static final double HOURS_PER_SESSION = 1.5;
	
	Collection<Offering> find(String name, Long programId, Long levelId, Long roomId, Long shiftId, Date startDate, Date endDate, Date fromDate, Date toDate, Date midtermWrittenDate, Date finalSpokenDate, Date finalWrittenDate, Date issueDate, Date cambridgeSpokenDate, Date cambridgeWrittenDate, Long monTeacherId, Long tueTeacherId, Long wedTeacherId, Long thuTeacherId, Long friTeacherId, Long satTeacherId, Long sunTeacherId, String comment); 
	
	Collection<Offering> findByNameStartWith(String prefix);
	
	Collection<Offering> findByMonthAndYear(int month, int year);
	
	Collection<Offering> findByDate(Date from, Date to);
	
	Collection<Offering> findByMidTestAndDate(Date from, Date to);
	
	Collection<Offering> findByFinalTestAndDate(Date from, Date to);
	
	Collection<Offering> findByTestDate(Date from, Date to);
	
	Collection<Offering> findByTeacherId(Long teacherId);
	
	Collection<Offering> findByTeacherIdSortByStartDate(Long teacherId);
	
	Collection<Offering> findByProgram(Long programId);
	
	Collection<Offering> findRecently();
	
	Offering findByNextOffering(Long nextOfferingId);
	
	int countByRoomId(Long roomId);
	
	Collection<Date> findTeachingDays(Long id);
	
	Collection<Date> findTeachingDays(Long id, Date from, Date to);
	
	Collection<Offering> findAllSortByStartDate();

	/* halnt */
	Collection<Offering> findByDateAndTeacher(Long teacherId, Date first, Date last);
	
	Collection<Offering> findAllOpening();
	
	Collection<Offering> findAllOpeningByMonthYear(int month, int year);
}